package com.engine4cloud.tdf.education.convert;

import com.engine4cloud.tdf.common.core.util.CodeUtils;
import com.engine4cloud.tdf.education.dto.create.EduPsychologicalCounsellingCreateDTO;
import com.engine4cloud.tdf.education.dto.result.EduPsychologicalCounsellingResultDTO;
import com.engine4cloud.tdf.education.dto.update.EduPsychologicalCounsellingUpdateDTO;
import com.engine4cloud.tdf.education.entity.EduPsychologicalCounsellingEntity;
import com.engine4cloud.tdf.education.entity.EduPublicWelfareActivitiesEntity;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;


@Mapper
public interface EduPsychologicalCounsellingConvert {
    EduPsychologicalCounsellingConvert INSTANCE = Mappers.getMapper(EduPsychologicalCounsellingConvert.class);

    EduPsychologicalCounsellingEntity createTo(EduPsychologicalCounsellingCreateDTO s);

    EduPsychologicalCounsellingEntity update(EduPsychologicalCounsellingUpdateDTO s);

    EduPsychologicalCounsellingResultDTO convert(EduPsychologicalCounsellingEntity s);

    default EduPsychologicalCounsellingEntity create(EduPsychologicalCounsellingCreateDTO s, Long tenantId) {
        EduPsychologicalCounsellingEntity entity = createTo(s);
        entity.setFdbh(CodeUtils.entrustCode());
        entity.setTenantId(tenantId);
        return entity;
    }
}
